This invention relates to application program interfaces which are used to access communication network functions and, more particularly, to an application program interface which isolates network function modifications from application programs.
Interface programs that enable communications between application programs and network functionality have been constructed in such a way that information regarding network communication protocols was fed to the interface program by the application. This required each application to maintain an updated set of network protocols which could be provided to the interface program, in the event a particular network protocol was to be used.
For example, networks which employ the TCP/IP protocol require that the interface establish a xe2x80x9csocketxe2x80x9d. A socket is a software construct which defines a repository or queue in a computer""s operating system for data being transmitted/received, keeps track of various parameters of a communication session, the necessary protocol and command information for the session, etc. In the prior art, an application program requests the creation of a xe2x80x9csocketxe2x80x9d from a network library.
The network library provides communication functionality for various application programs. Initially, the application program informs the network library of the protocol that is to be utilized over the particular network. Further, the application program informs the network library of the address format and various other details of how the addresses are to be administered by the protocol. In response to a call for a socket, the network library creates a socket software construct and return its handle (i.e., its name) to the application. Thereafter, the application, in the event of a dispatch of a message, calls a xe2x80x9csendxe2x80x9d action from the network library and passes the name of the socket and the address to which the data is to be dispatched. The network library then executes the send command, utilizing the protocol and other information provided by the application. Once the message is dispatched, the application informs the network library to close the socket.
A principal difficulty with the above-indicated procedure is that the application program needs to maintain updated records of the most current protocols to enable communications to be successfully accomplished. However, these protocols are subject to change over time. Thus, each time a protocol is added, each application needs to be revised in order to reflect the most updated version.
The socket creation procedure works well with monolithic applications which employ non-extensible network libraries. Some piece of code in some part of an application will always know which protocol is being used or is to be used. In a monolithic application, all developed by a single team, it is reasonable to let such knowledge infiltrate other parts of the application. However, today it is common for different teams to work on different components that make up a software product, and for those components to be used in many applications.
Consider the case of a network transport library that is shared by several applications. When a new transport function is added, all of the affected applications must be updated to take advantage of the new functionality. Since each application must know about the different protocols, it is not possible for one team of developers to add a new protocol and have it immediately useful in all applications that use the transport component.
Accordingly, it is an object of this invention to provide an application/network interface which avoids the requirement of protocol information being supplied by applications attempting to communicate over the network.
It is another object of this invention to provide an improved network interface which, itself, includes sufficient information to enable application programs to communicate over the network without requiring that the application program have a predetermined level of protocol knowledge.
The invention enables an application program to communicate a message over a network without having information regarding a protocol employed by the network. A network library program, running independently of the application program, stores communication protocol data and procedures for establishing message transport data structures to be used in communicating over the network. Initially, the application program passes an address string to the network library program. In response, the network library program determines a network protocol to be used by analyzing the received address string. The network library program then creates a xe2x80x9ctransport addressxe2x80x9d data structure which records both the protocol and the address string. The network library program further establishes a xe2x80x9ctransportxe2x80x9d data structure for the specific message type to be dispatched, which data structure includes a dispatch command and a socket handle to be used during the transmission. Thereafter, the application program invokes the network library program to proceed with execution of the message dispatch action by using both the transport address data structure and the transport data structure. Accordingly, only the network library program is required to maintain data regarding network protocols, and such data is invisible to the application program.